package com.example.springboottestservice.ioc.scop;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;

import javax.servlet.http.HttpSession;

@Configuration
public class ScopeConfig {

    @Bean
    public SingleBean singleBean(){
        return new SingleBean();
    }

    @Bean
    @Scope("prototype")
    public PrototypeBean prototypeBean(){
        return new PrototypeBean();
    }

    @Lazy
    @Bean
    public LazyBean lazyBean(){
        return new LazyBean();
    }

    @Bean
    public HttpSessionWrap httpSessionWrap(){
        return new HttpSessionWrap();
    }
}
